<?php

namespace app\common\validate;

use think\Validate;

//用户模型验证器
class Authrule extends Validate
{
    protected $rule = [
        'title' => 'require|max:15|unique:authrule',
        'name' => 'require|unique:authrule'

    ];

    protected $message = [
        'title.require' => '权限规则必须填写',
        'title.max' => '权限名称不能大于15个字',
        'title.unique' => '权限规则已经存在，请重新填写',
        'name.require' => '权限名称必须填写',
        'name.unique' => '权限名称已经存在，请重新填写'
    ];

    protected $scene = [
        'add' => ['name', 'title'],
        'edit' => ['name', 'title']
    ];
}
